﻿@using LY.Business.ServiceImpl
@using LY.Entity
@using LY.Entity.Entities
@using LY.Interface
@{ 
    Layout = "~/Views/Shared/_Layout.cshtml";
    R_Project_EX project = ViewBag.Project;
    var beginTime = "2015-12-12";
    DateTime endTime = Convert.ToDateTime("2015-12-05");
    if (project.AuditTime != null)
    {
        beginTime = project.AuditTime.Value.ToString("yyyy-MM-dd");
        endTime = (DateTime)project.AuditTime.Value.AddDays((double)project.CollectDays);
    }

    R_ProjectClass projectClass = ViewBag.ProjectClass;
    List<R_ProjectOrder_EX> list = ViewBag.InvestmentList;
    U_Member member = ViewBag.Member;
    var projectCount = ViewBag.ProjectCount;
    List<U_Member_EX> memberList = ViewBag.MemberList;//最近支持者
    List<R_ProjectDatelinetree> datelinetree = ViewBag.projectDatelinetrees;//项目进展

    var u = Session["CurrentUser"] as LY.Entity.U_Member;
    IProjectService _projectService = new ProjectService(); 
}
<link href="~/Content/project.css" rel="stylesheet" />
<link href="~/Content/assets/js/jqueryui.css" rel="stylesheet" />
<script src="~/Content/assets/js/jqueryui-1.10.3.min.js"></script>

<div class="change_banner"></div>
<div class="line10"></div>
<div class="container">
    <div class="layout">
        <div class="project-tilte">
            <h1>@project.ProjectName</h1>
            <p class="red"><span class="mr10">@beginTime - @endTime.ToString("yyyy-MM-dd")</span>火热筹款中</p>
        </div>
        <div class="line30"></div>
        <div class="project-content">
            <div class="col-left">
                <div class="cover">
                    <img   src=@project.ProjectThumImage1 class="cover-img" style="width: 653px;">
                </div>
                <div class="content">
                    <div class="box_hm mt20 clearfix">
                        <ul class="tab_ul" id="detailNav">
                            <li class="bg_write" clstag="jr|keycount|zc_detail|zc_xmzy">项目主页</li>
                            <li id="qaBtn" clstag="jr|keycount|zc_detail|zc_zd_zdan" onclick="gotoArea('#progress',800)">项目进展<span class="r_bg">@datelinetree.Count</span>
                            </li>
                            <li id="topicBtn" clstag="jr|keycount|jr_zc_detail|hty" onclick="gotoArea('#huati',800)">话题 <span class="r_bg">
                                <label id="sumTopic"></label>
                            </span></li>
                            <li id="supporterBtn" clstag="jr|keycount|jr_zc_detail|zcy" onclick="gotoArea('#surporter',800)">支持者 <span class="r_bg">@memberList.Count</span></li>
                        </ul>
                        <div class="tab_cont" style="display: block">
                            <div class="mb30">
                                @if (project.VideoAddr != null && LY.Common.Utility.IsURL(project.VideoAddr))
                                {
                                    <div class="flash_box">
                                        <object id="myFlash" name="myFlash" width="100%" height="100%" align="top" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" classid="clsid:001">
                                            <param value="@project.VideoAddr" name="movie">
                                            <param value="high" name="quality">
                                            <param value="transparent" name="wmode">
                                            <param value="true" name="allowFullScreen">
                                            <param value="never" name="allowScriptAccess">
                                            <embed width="100%" height="100%" align="top" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="never" allowfullscreen="true" wmode="transparent" name="myFlash" swliveconnect="true" quality="high" src="@project.VideoAddr" id="myFlash" allownetworking="all">
                                        </object>
                                    </div>
                                }
                                <br>
                                <p>
                                    @Html.Raw(project.ProjectDetails)
                                </p>
                            </div>
                            <div class="con_tit">
                                <div class="fl">
                                    标签：
                                    <a style="color: red;" target="_blank" href="#">标签1</a>
                                    <a style="color: red;" target="_blank" href="#">标签2</a>
                                </div>
                                <div class="fr">
                                    @Html.Partial("_Snshare", project);
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--------项目进展框开始---------->

                    <div id="progress" class="box_hm mt20">
                        <h1 class="font18_hm mtb10">
                            <span class="fl">项目进展</span>
                            <span clstag="jr|keycount|zc_detail|zc_fqht" class="fr f_blue pr30" onclick="gotoArea('#huati',800)">发起话题</span>
                        </h1>
                        <div class="cont_hm clearfix">
                            <div class="bg_yellow">这里记录了项目发起人更新的项目进展，您可以发起话题或评论与发起人进行交流。</div>
                            @{
                               
                                foreach (var rProjectDatelinetree in datelinetree)
                                {
                                <div class="cont_con clearfix pr" style="margin-left: 40px;">
                                    <div class="fl bo_left_time" style="left: -68px;">
                                        <em>
                                            @DateTime.Parse(rProjectDatelinetree.AddTime.ToString()).ToString("MM-dd")
                                        </em>
                                        <i class="icon_crl"></i>
                                    </div>
                                    <div class="fl bo_left">
                                        <p>@rProjectDatelinetree.Demo</p>
                                    </div>
                                </div>
                                }
                            }


                        </div>
                    </div>
                    <!--------项目进展框结束---------->

                    <!--------项目答疑框开始---------->
                    <form id="questionform">
                        <input id="ProjectId" name="ProjectId" value="@project.Id" type="hidden" />
                        <input name="Message" type="hidden" />
                        <div id="question" class="box_hm mt20">
                            <h1 class="font18_hm mtb10">
                                <span id="prq" class="fl" style="border-bottom: 3px solid #F35D5D">项目答疑</span>
                                <span id="myq" class="f1">我的问题</span>
                                <span clstag="jr|keycount|zc_detail|zc_fqht" class="fr f_blue pr30" onclick="gotoArea('#area',800)">我要提问</span>
                            </h1>
                            <div id="q_files" class="cont_hm clearfix">
                                暂无任何相关问题
                            </div>
                            <div style="padding: 25px;">
                                <span style="font-size: 18px;">有什么疑问想要告诉项目发起人？</span><br />
                                <br />
                                <textarea maxlength="200" style="resize: none" id="area" cols="70" rows="6" placeholder="您的提问将会以邮箱或者站内私信回复您哦~"></textarea><br />
                                <br />
                                <span style="float: right">可以输入<b>200</b>字</span><br />
                                电话：<input name="Phone" id="txtTel" readonly="true" value="" type="text" style="border: none; border-bottom: 1px solid gray;" />
                                <span>问题一旦被采纳，我们会第一时间短信通知您</span>
                                <br />
                                <br />
                                @if (u != null)
                                {
                                    if (u.IsPhoneValidate)
                                    { 
                                    <script>$("#txtTel").val('@u.Mobilenumber.Substring(0, 3)' + "****" + '@u.Mobilenumber.Substring(6, 4)');</script>
                                    <span>[*若更改手机号,请到个人中心进行重新绑定]</span>
                                    }
                                    else
                                    {
                                    <span>您还没有绑定手机号，是否现在去<a href="/Account/PhoneCertification">绑定</a>?</span>
                                    }
                                   
                                    <input id="btnSubmit" class="btn130" type="button" value="提交问题" />
                                }
                                else
                                {
                                    <span>您还未登陆，请登陆后提问,立即&nbsp;<a href="/Login/Index">登录</a>&nbsp;或&nbsp;<a href="/Login/Register">注册</a></span>
                                }
                            </div>
                            <!--------项目进展框结束---------->
                            <!--------话题---------->
                            <div id="huati" class="box_hm mt20">
                                <h1 class="font18_hm mtb10">
                                    <span class="fl">最新话题</span>
                                </h1>
                                <div class="cont_hm clearfix">
                                    <!-- 多说评论框 start -->
                                    <div class="ds-thread" data-thread-key="@project.Id" data-title="@project.ProjectName" data-url=" @Request.Url"></div>
                                    <!-- 多说评论框 end -->
                                    <!-- 多说公共JS代码 start (一个网页只需插入一次) -->
                                    <script type="text/javascript">
                                        var duoshuoQuery = { short_name: "changerbank" };
                                        (function () {
                                            var ds = document.createElement('script');
                                            ds.type = 'text/javascript'; ds.async = true;
                                            ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
                                            ds.charset = 'UTF-8';
                                            (document.getElementsByTagName('head')[0]
                                                || document.getElementsByTagName('body')[0]).appendChild(ds);
                                        })();
                                    </script>
                                    <!-- 多说公共JS代码 end -->
                                </div>
                            </div>
                            <!--------最近支持者---------->
                            <div id="surporter" class="box_hm mt20">
                                <h1 class="font18_hm mtb10">
                                    <span class="fl">最新支持者</span>
                                    <span clstag="jr|keycount|zc_detail|zc_ckqbzcz" name="support_div" class="fr f_blue pr30">去看全部支持人</span>
                                </h1>
                                <div class="cont_hm clearfix">
                                    <ul class="cont_hm_man">
                                        @foreach (var item in memberList)
                                        {
                                            <li>
                                                <img width="80" height="80" src=@item.HeadImage>
                                                <em></em>
                                                <span title="jd_55802ae03334f">@item.Nickname
                                                </span>
                                                @*<span title="jd_55802ae03334f">支持:'@item.Amount'
                                                </span>*@
                                                @* <em></em>
                                                <span title="jd_55802ae03334f">下单时间:'@item.PayTime'
                                                </span>
                                                <em></em>
                                                 <span title="jd_55802ae03334f">订单编号:'@item.SerialNumber'
                                                </span>*@
                                            </li>
                                        }
                                    </ul>
                                </div>
                            </div>

                            <!--------最近支持者结束---------->
                        </div>
                        <div id="J_jrCommonPromoBottom" class="mt20 xPromotion-border" clstag="jr|keycount|zc_detail|zc_zd_dbgg"></div>
                    </form>
                </div>

            </div>
            <!---------整个最后边一数列开始--------------->
            <div class="col-right">
                <div class="box schedule-box h145 mb20">
                    <div class="money-box pr clearfix">
                        @{
                            var aaa = _projectService.QueryProjectExpand(project.Id);
                            if (null != aaa)
                            {
                            <a   id="guanzhu_@project.Id"   href="javascript:;" class="attention a-normal" style="color: #FFF" onclick="guanzhuclick(@project.Id,@ViewBag.nowMemberID,1)">关注<span class="font14">(@aaa.guanzhu)</span></a>
                            <a  id="support_@project.Id"  href="javascript:;" class="praise p-normal" style="color: #FFF" onclick="zanclick(@project.Id,2)">赞 <i class="support-icons"></i>(<span class="font14">@aaa.zan</span>)</a>
                       
                            }
                            else
                            {
                            <a   id="guanzhu_@project.Id"   href="javascript:;" class="attention a-normal" style="color: #FFF" onclick="guanzhuclick(@project.Id,@ViewBag.nowMemberID,1)">关注<span class="font14">(0)</span></a>
                            <a  id="support_@project.Id"  href="javascript:;" class="praise p-normal" style="color: #FFF" onclick="zanclick(@project.Id,2)">赞 <i class="support-icons"></i>(<span class="font14">0</span>)</a>
                       
                            }
                        }
                    </div>
                    <div class="reserve">
                        <div class="share">
                            <p id="J_Share" class="share-icons">
                            </p>
                            <div class=" sns-icon-20">
                                <div class="sns-iconshare-panel  sns-iconshare-expand ">
                                    @Html.Partial("_Snshare", project)
                                </div>
                            </div>
                            <p></p>
                        </div>
                    </div>

                </div>
                <!---------已筹到开始--------------->
                <div class="box clearfix pr">
                    <div class="font14">
                        <p class="font18 mb20">已筹到</p>
                        <p><span class="font27">￥</span><span class="font45">@ViewBag.AllAmount</span></p>
                        <p class="lh24 mb20" id="projectMessage">
                            此项目必须在
                            <span class="f_red">@endTime.ToString("yyyy-MM-dd")</span>
                            前得到
                            @{
                                TimeSpan ts = endTime - DateTime.Now;
                                var restDays = 0;
                                if (endTime > DateTime.Now)
                                {
                                    restDays = ts.Days;
                                }

                                /* amount = project.Amount.ToString().Substring(0, project.Amount.ToString().Length - 2);*/
                                
                            }

                            <span class="f_red">￥@project.Amount</span>的支持才可成功！剩余<span class="f_red"> @restDays</span>天!
                        </p>
                        <i class="icon_pag">众筹中
                        </i>
                    </div>

                    <div class="reserve">
                        @{
                            var moneyPercent = ViewBag.AllAmount / project.Amount * 100;
                        }
                        @if (moneyPercent >= 100)
                        {
                            <span class="schedule-bar"><i class="schedule-current " style="width: 100%;"></i></span>
                        }
                        else
                        {
                            <span class="schedule-bar"><i class="schedule-current " style="width: @moneyPercent%;"></i></span>
                        }

                    </div>
                    @{
                        int supportcount = 0;
                        for (int i = 0; i < list.Count; i++)
                        {
                            supportcount = supportcount + list[i].PersonCount;
                        }
                    }
                    <p class="font14">
                        <strong>@supportcount</strong>
                        <label>名支持者</label>
                    </p>
                </div>
                <!---------已筹到结束--------------->

                <div class="repays mt20">
                    <div class="repay-box">
                        <!---------项目发起人开始--------------->
                        <div id="projectOwner" class="box328 repay mtb10">
                            <h1 class="font18_hm mtb10">项目发起人</h1>
                            <div class="cont_hm clearfix">
                                <div class="fl mr15 picPr">
                                    @* <a href="/funderCenter.action?flag=2&amp;id=26766" target="_self">*@
                                    <img height="56" width="56" src="@member.HeadImage" alt="">
                                    <span></span>
                                    @*</a>*@
                                </div>
                                <div class="fl">
                                    <h2 class="font18">
                                        <a href="javascript:;" title="">@member.Name
                                        </a>
                                        @*   <i class="icon_v" title="实名证名"></i><i class="icon_star" title="发起达人"></i>*@

                                    </h2>
                                    <p class="lh24" title="">
                                    </p>
                                    <p class="lh24">
                                        发起：
                                        <span class="f_red">
                                            <strong>@projectCount</strong></span>
                                        &nbsp;&nbsp;&nbsp;&nbsp;支持：
                                        <span class="f_red">
                                            <strong>1</strong>
                                        </span>
                                        <a onclick="emailClick()" class="ui-tab-line">
                                            <i class="icon_email"></i>
                                        </a>
                                    </p>

                                </div>
                            </div>


                            <!---发送私信------->
                            <input type="hidden" id="MemberId" name="MemberId" value="@member.ID"/>
                            <div id="sendEmail" style="display: none">

                                <h2>收件人：<span>
                                    <label id="lblMname" name="lblMname">@member.Nickname </label>
                                </span>
                                </h2>

                                <textarea id="Message" name="Message" datatype="*" class="input normal" nullmsg="请输入内容"></textarea>
                                <p class="tr">
                                    <span class="input-box">
                                        <input type="text" style="width: 200px;" class="input normal" name="validateCode" id="validateCode" datatype="*" maxlength="5" placeholder="请输入验证码" />&nbsp;
                  
                                    </span>
                                    <img id="valiCode" width="80" height="26" src="/Login/GetValidateCode" />
                                </p>
                                <br />

                                <input type="button" id="sure" value="确定" class="button" />
                                <input type="button" id="return" onclick="window.parent.location.reload()" class="button" value="取消" />

                            </div>
                            <!---发送私信结束------->


                            <!---------项目发起人结束--------------->
                            <!---------档位的投资开始--------------->
                            <div id="zixun"></div>
                            @{
                                foreach (var item in list)
                                {
                                <div class="box328 repay mtb10 ">
                                    <h1 class="font18_hm mtb10  pospr">
                                        <span class="fl">支持￥@item.ItemAmount</span>
                                        <span name="support_div" class="fr f_blue co666 pr35 " clstag="jr|keycount|zc_detail_201504172|12">@item.PersonCount 位支持者</span>
                                    </h1>
                                    <div class="cont_hm clearfix">
                                        @{ var result = item.Limits - item.PersonCount;
                                           if (item.Limits == 0)
                                           {
                                            <p class="mb20 pr">
                                                <label>不限人数</label>
                                            </p>
                                           }
                                           else
                                           {
                                            <p class="mb20 pr">
                                                限额 <strong>@item.Limits 位</strong>|
                                                    剩余 <strong>@result 位</strong>
                                            </p>
                                           }
                                       
                                        }

                                        <p class="lh24">@item.returnContent</p>
                                        <p class="lh24">
                                            <img class="upload-img1" src="@item.RedoundImage" big-data="@item.RedoundImage" onload="imgResize(this,80)" style="height: 80px;">
                                        </p>
                                        <p class="lh24">
                                            <strong>配送费用：</strong>
                                            @{
                                           if (item.Freight <= 0)
                                           {
                                                <label>免运费</label>
                                           }
                                           else
                                           {
                                                <label>运费:@item.Freight.00元</label>
                                           }
                                            }
                                        </p>
                                        <p class="lh24"><strong>预计回报发送时间：</strong>项目成功结束后 @item.DedoundDays 天内</p>

                                        @if (project.AuditTime == null)
                                        {
                                            <p class="mt10">
                                                <button type="button" disabled="disabled" value="@item.ItemAmount" itemid="@item.ItemId" jrtag="28|107666" id="m-private-107666" class="btn130 mybutton" scramble="0" redoundid="107666" ordfrom="other" projectid="26766"  clstag="jr|keycount|jr_zc_detail|xmzc">支持￥@item.ItemAmount</button>
                                            </p>
                                        }
                                        else
                                        {

                                            if (item.Limits == 0 || item.Limits > item.PersonCount)
                                            {
                                                if (DateTime.Now < endTime)
                                                {
                                                    if (ViewBag.AllAmount < project.Amount)
                                                    {
                                            <p class="mt10">
                                                <button type="button" value="@item.ItemAmount" itemid="@item.ItemId" jrtag="28|107666" id="m-private-107666" class="btn130 mybutton" scramble="0" redoundid="107666" ordfrom="other" projectid="26766"  clstag="jr|keycount|jr_zc_detail|xmzc">支持￥@item.ItemAmount</button>
                                            </p>
                                                    }
                                                    else
                                                    {
                                            <p class="mt10">
                                                <span style="font-size: 20px; color: #EC303F;">众筹已完成！</span>
                                            </p> 
                                                    }
                                                }
                                                else
                                                {
                                            <p class="mt10">
                                                <span style="font-size: 20px; color: #EC303F;">众筹已结束！</span>
                                            </p> 
                                                }
                                            }
                                            else
                                            {
                                            <p class="mt10">
                                                <span style="font-size: 20px; color: #EC303F;">该回报档位已满！</span>
                                            </p>
                                            }
                                        }
                                    </div>
                                </div>
                                }
                            }
                            <!---------档位的投资结束--------------->

                            <!--------关于支持与退款开始--------->
                            <div class="box328 repay mtb10 blue_bg">
                                <h1 class="font18_hm mtb10">关于支持与退款</h1>
                                <div class="cont_hm clearfix">
                                    <p class="lh24">
                                        这个项目必须在
                                      
                                        <strong class="f_red">@endTime.ToString("yyyy-MM-dd")</strong>之前达到<strong class="f_red">￥@project.Amount</strong>的目标才算成功，否则已经支持的订单将取消。
                                    </p>
                                    <p class="lh24">订单取消时，您的支持金额，将原路返回到您的储蓄卡和信用卡里。</p>
                                </div>
                            </div>
                            <!--------关于支持与退款结束--------->
                        </div>
                    </div>
                </div>
                <!---------整个最后边一数列结束--------------->
            </div>
            <div class="recommend">
                <div class="layout">
                </div>
            </div>
            <div class="line10"></div>
            <!-------最下面的猜你喜欢模块开始--------->
            @Html.Partial("_CainiXihuang", "detail")
            <!-------最下面的猜你喜欢模块结束--------->
        </div>
        @section scripts{
            <script type="text/javascript">

                $(function () {

                    var projectName = '@project.ProjectName';
                    $(".mybutton").click(function () {
                        var login = '@Session["CurrentUser"]';
                        if (login == null || login == "") {
                            window.location.href = "/Login/Index';
                            return;
                        }
                        var url = "/UserOrder/AddOrder?projectName=" + encodeURI(projectName) + "&itemid=" + $(this).attr("itemid");
                        window.location.href = url;
                    });

                    $(".upload-img1").click(function () {
                        var img = $(this).attr("src");
                        var title = $(this).attr("title");
                        $.dialog({
                            id: 'a15',
                            title: title,
                            lock: true,
                            content: '<img src="' + img + '" width="650"/>',
                            padding: 0
                        });
                    });

                    gettopic('@project.Id');
                });

                //获取话题数
                function gettopic(id) {
                    $.ajax({
                        url: "http://api.duoshuo.com/threads/counts.jsonp?short_name=changerbank&threads=" + id,
                        type: "GET",
                        contentType: 'application/json',
                        dataType: 'jsonp',
                        success: function (data) {
                            var Sumtopic = data.response[id].comments;
                            $("#sumTopic").html(Sumtopic);
                        }
                    });
                };

                //点击信封弹框
                function emailClick(parameters) {
                    $("#valiCode").click();
                    keleyidialog();

                    //点击验证码
                    $("#valiCode").click(function () {
                        this.src = "/Login/GetValidateCode?time=" + (new Date()).getTime();
                    });
                    $("#sure").click(function () {
                        if ($("#Message").val().trim() != "") {
                            var memberid = $("#MemberId").val();
                            var Message = $("#Message").val();
                            var validateCode = $("#validateCode").val();
                            if (validateCode.trim() != "") {
                                $.ajax({
                                    type: "post",
                                    url: "/Default/SendMessage",
                                    data: { Message: Message, MemberId: memberid, validateCode: validateCode },
                                    success: function (msg) {
                                        if (msg.Status == -2) {
                                            window.parent.location.href = "/Login/Index";
                                        } else if (msg.Status == -1) {
                                            $("#valiCode").click();
                                            $("#validateCode").val("");
                                            $.dialog.tips(msg.Message, 2, 'tips.gif');
                                        } else {
                                            $.dialog.tips(msg.Message, 2, 'tips.gif', function () {
                                                window.parent.location.reload();
                                            });
                                        }
                                    }
                                });
                            } else {
                                $.dialog.tips("请输入验证码！", 1, 'tips.gif');
                            }
                        } else {
                            $.dialog.tips("请输入私信内容！", 1, 'tips.gif');
                        }
                    });
                }

                function keleyidialog() {
                    $.dialog({
                        lock: true,
                        background: '#000', /* 背景色 */
                        opacity: 0.5,       /* 透明度 */
                        width: 400,
                        height: 250,
                        // content: "url:/Default/SendEmail?MemberId=" + $("#MemberId").val(),
                        content: $("#sendEmail").html(),
                        title: '发送私信',
                    });
                }


                //***xulai-begin***//
                //加载初始化显示
                showCommon("/Project/QuestionList?pid=" + '@project.Id', 1);

                function showCommon(url, e) {

                    $.post(url, function (json) {
                        if (json != "Undefined") {
                            var html = "";
                            for (var i = 0; i < json.length; i++) {
                                var date = new Date(parseInt(json[i].CreateTime.substring(6, json[i].CreateTime.indexOf(')')))).toLocaleString();
                                if (json[i].RMemberId == null) {

                                    html = html + "<div style='clear:both;'><img src='" + json[i].HeadImage + "' style='border-radius:50%;' height='50px' width='50px' /><br/><b>" + json[i].Name.substring(0, 1) + "****" + json[i].Name.substr(json[i].Name.length - 1, 1) + "</b><span style='position:absolute;margin:-35px 0 0 40px;'>" + date + "</span></div><div style='height:5px;width:10px;background-color:pink;margin:-31px 0 0 50px;position:absolute;border-radius:50%;border:1px solid gray;'></div><div><div style='float:left;margin:-30px 0 0 70px;position:relative;border-radius:10px;border:1px solid gray;padding:15px;background-color:pink;max-width:70%;'>" + json[i].Message + "</div></div>";

                                } else {
                                    html = html + "<div style='clear:both;'><div style='height:5px;width:10px;background-color:#ECECEC;margin:40px 0 0 540px;position:absolute;border-radius:50%;border:1px solid gray;'></div><img src='@member.HeadImage' style='border-radius:50%;float:right;' height='50px' width='50px'  /><br/><br/><br/><b style='float:right'>@member.Name</b><span style='margin:-23px 0 0 390px;position:absolute;'>" + date + "</span><div style='float:right;margin:0 30px 0 70px;position:relative;border-radius:10px;border:1px solid gray;padding:15px;background-color:#ECECEC;max-width:70%;'>" + json[i].Message + "</div></div>";
                                }
                            }
                            if (json.length == 0) {
                                html = "暂无任何问题，如有任何问题可以提问项目发起人哦~";
                            }
                        } else {
                            if (e == 2) {
                                html = "<span>您还未登陆，请登陆后提问,立即&nbsp;<a href='/Login/Index'>登录</a>&nbsp;或&nbsp;<a href='/Login/Register'>注册</a></span>";
                            } else {
                                html = "暂无任何问题";
                            }
                        }
                        $("#q_files").html(html + "<br/><br/><br/>").fadeIn(1000);

                    })
                }

                $("#myq").click(function () {
                    showCommon("/Project/MyQuestionList?pid=" + '@project.Id', 2);
                    $("#q_files").css("display", "none");
                    $(this).css("border-bottom", "3px solid #F35D5D");
                    $("#prq").css("border-bottom", "0px");
                })

                $("#prq").click(function () {
                    showCommon("/Project/QuestionList?pid=" + '@project.Id');
                    $("#q_files").css("display", "none");
                    $(this).css("border-bottom", "3px solid #F35D5D");
                    $("#myq").css("border-bottom", "0px");
                })

                function gotoArea(area, time) {
                    $('html,body').animate(
                        {
                            scrollTop: $(area).offset().top - 300
                        },
                        time);
                }

                $("#btnSubmit").click(function () {

                    var content = $("#questionform textarea").val();
                    $(":input[name='Message']").val(content);
                    if (content.trim() != "") {
                        $.post(
                            "/Project/SubmitQuestion",
                            $("#questionform").serialize(),
                            function (json) {
                                if (json.Status > 0) {
                                    $.dialog.tips(json.Message, 2, 'tips.gif');
                                    location.href = json.Data;
                                } else {
                                    $.dialog.tips(json.Message, 2, 'tips.gif');
                                }
                            })
                    } else {
                        $.dialog.tips("请输入您的问题哦~", 2, 'tips.gif');
                    }
                })
                //***xulai-end***//
            </script>

        }
    </div>
</div>
